home *** CD-ROM | disk | FTP | other *** search
- ; $VER: Install_TCalcStats2b (03.07.99)
- (procedure P-check-system-version
- (if (< (/ @installer-version 65536) 43)
- (abort "The TCalcStats2 installation script needs Installer\n"
- "version 43 or higher. It is available from Aminet\n")
- )
- (set #exec-version (/ (getversion) 65536))
- (if (< #exec-version 37)
- (abort "TCalcStats2 needs Kickstart 2.04 or higher.\n")
- )
- (if (< #exec-version 39)
- (set #ag-browser "AmigaGuide")
- (set #ag-browser "MultiView")
- )
- )
- (procedure P-select-start-directory
- (set #HelpPattern "Stats_Help")
- (set #ArexxPattern "Arexx")
- (set #HelpDir "Help")
- (set #LibPattern "Libs")
- )
-
- (procedure P-select-destination-directory
- (if (exists "Turbocalc:" (noreq))
- (
- (set #old-tcalc-assign 1)
- (set #old-tcalc-assign-location (expandpath "Turbocalc:"))
- (set @default-dest
- (askdir
- (prompt "Select the directory where you want to "
- "install the main files. You already have a 'Turbocalc:' "
- "assign on your system. I will install in the Arexx "
- "drawer there (or the scripts will not work!).")
- (help "Select the directory where you want to "
- "install the main files. You already have a 'Turbocalc:arexx' "
- "drawer on your system so please accept "
- "the default or the scripts will not work!")
- (default "Turbocalc:")
- )
- )
- (set #final "Turbocalc:")
- ) (
- (set #old-tcalc-assign 0)
- (if (exists "Work:" (noreq))
- (set @default-dest "Work:")
- (set @default-dest "SYS:")
- )
- (set @default-dest
- (askdir
- (prompt "Select the directory where you want to "
- "install the main files. An additional directory "
- "will *NOT* be created at the location you specify. "
- "You MUST put the files in the TurboCalc/arexx drawer "
- "or the scripts will not work!!")
- (help "Select the directory where you want to "
- "install the main files. All arexx script files, the "
- "turbocalc macro spreadsheet file will be copied "
- "to that directory during installation. A new directory "
- "will *NOT* be created at the location you specify. "
- "This means if you want TCalcStats2 to be installed in its "
- "own directory then you need to create that directory "
- "yourself first.")
- (default @default-dest)
- )
- )
- (set #final @default-dest)
- )
- )
- )
-
- (procedure P-select-destination-help
- (if (exists "Turbocalc:" (noreq))
- (
- (set #old-tcalc-assign 1)
- (set #old-tcalc-assign-location (expandpath "Turbocalc:"))
- (set @default-dest
- (askdir
- (prompt "Select the directory where you want to "
- "install the help files. You already have a 'Turbocalc:' "
- "assign on your system, so it is assumed that this "
- "is the location that you want to use.")
- (help "Select the directory where you want to "
- "install the help files. Since you already have a 'Turbocalc:Help' "
- "drawer on your system you should probably accept "
- "the default.")
- (default "Turbocalc:Help")
- )
- )
- ) (
- (set #old-tcalc-assign 0)
- (if (exists "Work:" (noreq))
- (set @default-dest "Work:")
- (set @default-dest "SYS:")
- )
- (set @default-dest
- (askdir
- (prompt "Select the directory where you want to "
- "install the Help files. An additional directory "
- "will be created at the location you specify.")
- (help "Select the directory where you want to "
- "install the help files. Amigaguide and html help files "
- "will be copied to a new directory during installation. "
- "A new directory will be created at the "
- "location you specify. This means if you want the help "
- "files to be installed in another directory then "
- "you need to create that directory yourself first.")
- (default @default-dest)
- )
- )
- )
- )
- )
-
-
- (procedure P-copy-file
- (copyfiles
- (source (tackon #source-dir #to-copy))
- (dest @default-dest)
- (optional force)
- (infos)
- )
- )
-
- (procedure P-add-to-startup
- (if #old-tcalc-assign
- (if (= (#old-tcalc-assign-location (expandpath @default-dest)))
- (set #change-startup 0)
- (set #change-startup 1)
- )
- (set #change-startup 1)
- )
- (if #change-startup
- (if
- (askbool
- (prompt "It is NECESSARY that an assign "
- "'Turbocalc:' is created for the TCalcStats2 installation. "
- "Would you like Installer to make the required change "
- "to your user-startup file ? "
- "If you answer 'No' then you need to make the "
- "addition yourself, manually, before you can use TCalcStats2.")
- (help "It is NECESSARY that an assign "
- "'Turbocalc:' is created for the TCalcStats2 installation "
- "The arexx scripts need this to work properly! "
- "If you answer 'No' then you need to make the "
- "addition yourself, manually, before you can use TCalcStats2. "
- "You should only answer with 'No' if you prefer to edit "
- "the user-startup file yourself. If you answer 'No' then "
- "a file 'addition-to-user-startup' will be created in the "
- "Turbocalc installation directory instead. You need to add the "
- "contents of that file to your user-startup file.")
- (choices "Yes" "No")
- )
- (
- (set @default-dest
- (askdir
- (prompt "Select the location where Turbocalc is "
- "installed.")
- (help "Select the drive/directory where Turbocalc "
- "is installed.")
- (default @default-dest)
- )
- )
- (set #startup-addition (cat
- "assign Turbocalc: \"" (expandpath @default-dest) "\"\n"
- )
- )
- (startup "Turbocalc"
- (command #startup-addition)
- (prompt "Installer will modify your s:user-startup "
- "script. The following lines will be added:\n\n"
- #startup-addition)
- (help "Installer will modify your s:user-startup "
- "script. The following lines will be added:\n\n"
- #startup-addition)
- )
- (textfile
- (dest (tackon @default-dest "addition-to-user-startup"))
- (append #startup-addition)
- )
- )
- )
- )
- )
-
- (welcome "Welcome to the TCalcStats2 installation.\n")
-
- (set app-name "TCalcStats2b")
-
- (P-check-system-version)
-
- (complete 0)
-
- (set #SourceDir (if (= 1 (exists @icon)) (pathonly (expandpath @icon))
- (expandpath @icon))
- )
- (P-select-start-directory)
- (P-select-destination-directory)
-
- (complete 10)
-
- ; start actual installation
- (copyfiles
- (prompt "Copying arexx scripts...")
- (source #SourceDir)
- (dest @default-dest)
- (pattern #ArexxPattern)
- (infos)
- )
- (complete 20)
- (copyfiles
- (prompt "Copying arexx library files to libs:...")
- (source (tackon #SourceDir "libs"))
- (dest "libs:")
- (all)
- (optional force)
- )
- (complete 40)
-
- (P-select-destination-help)
- (copyfiles
- (prompt "Copying help files...")
- (source #SourceDir)
- (dest @default-dest)
- (pattern #HelpPattern)
- (infos)
- )
- (complete 80)
-
- (set @default-dest #final)
- (P-add-to-startup)
-
- (complete 100)
-
- (exit "The installation of TcalcStats2 is finished.")
-